import axiosInstance from '@/utils/axiosInstance';

const roleApi = {
  list: (current, pageSize) => {
    return axiosInstance.get(`/ui/role/list?current=${current}&pageSize=${pageSize}`);
  },
  add: data => {
    return axiosInstance.post('ui/role/add', data);
  },
  getDataById: id => {
    return axiosInstance.get(`ui/role/find?id=${id}`);
  },
  update: data => {
    return axiosInstance.post('ui/role/update', data);
  },
  delete: id => {
    return axiosInstance.patch('ui/role/delete', id);
  },
  allRoles: () => {
    return axiosInstance.get('ui/role/allRoles');
  }
};

export default roleApi;
